package com.iqiyi.pps.epg.core.model.basement;

import com.iqiyi.pps.epg.core.model.base.BaseEntity;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: qiyi
 * Date: 12-8-27
 * Time: 下午4:57
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "show_constants_map")
@Cache(usage = CacheConcurrencyStrategy.NONE)
public class ConstantsMap extends BaseEntity {

    public static final int CONSTANTS_MAP_TYPR_TAG=1;
    public static final int CONSTANTS_MAP_TYPR_DATA=2;


    private Long id;

    private String name;

    private Integer type;  //类型

    private String code;

    private String value;

    @Column(name = "code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "type")
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public final static Map<Integer,String> getConstantsMap(){
        Map<Integer,String> constantsMap = new HashMap<Integer,String>(){{
            put(CONSTANTS_MAP_TYPR_TAG,"标签");
            put(CONSTANTS_MAP_TYPR_DATA,"基础数据");
        }};

        return constantsMap;
    }
}
